package com.jxsd.edu.cn.struts2.actions;

import com.jxsd.edu.cn.struts2.models.Pmsgstoreview;
import com.jxsd.edu.cn.struts2.serviceImpl.StoreServiceImpl;
import com.jxsd.edu.cn.struts2.services.StoreService;
import com.opensymphony.xwork2.ActionContext;


/**
 * 收藏管理
 * */
public class StoreAction 
{
	private   Pmsgstoreview store;
	
	//StoreService
    private   StoreService   storeService=new  StoreServiceImpl();
    
  /**
   * 添加一条收藏记录
   * */ 
	public  String  addDtore()
	{
		Integer  userId=(Integer)ActionContext.getContext().getSession().get("userId");
		store.setUserId(userId);
		storeService.addstore(store); 
		return  "delete";
	}
	/**
	 * 删除一条收藏记录
	 * */
	public  String  deleteStore()
	{
		storeService.deletestore(Integer.toString(store.getPublishId()));
		return "delete";
	}
	
	
	public Pmsgstoreview getStore() {
		return store;
	}
	public void setStore(Pmsgstoreview store) {
		this.store = store;
	}
}
